From 832085e21c1c24a5cf3aa5607f0c147f66f89585 Mon Sep 17 00:00:00 2001 From: Stefano Stabellini Date: Fri, 25 Feb 2011 18:41:34 +0000 Subject: [PATCH] xl: fix tap:aio disk parsing Fix "tap:aio" parsing in xl after 22921 Signed-off-by: Stefano Stabellini Committed-by: Ian Jackson --- tools/libxl/xl_cmdimpl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 0fad4711ce..fe136eeab6 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -451,8 +451,6 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2) char *p, *end, *tok; memset(disk, 0, sizeof(*disk)); - disk->format = DISK_FORMAT_RAW; - disk->backend = DISK_BACKEND_TAP; for(tok = p = buf2, end = buf2 + strlen(buf2) + 1; p < end; p++) { switch(state){ @@ -484,7 +482,11 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2) } break; case DSTATE_TAP: - if ( *p == ':' ) { + if (*p == ',') { + disk->format = DISK_FORMAT_RAW; + disk->backend = DISK_BACKEND_TAP; + state = DSTATE_PHYSPATH; + } else if ( *p == ':' ) { *p = '\0'; if (!strcmp(tok, "aio")) { tok = p + 1; @@ -510,8 +512,10 @@ static int parse_disk_config(libxl_device_disk *disk, char *buf2) tok = p + 1; state = DSTATE_PHYSPATH; + break; + } else { + break; } - break; case DSTATE_PHYSPATH: if ( *p == ',' ) { int ioemu_len; -- 2.30.2